package app.kernel.api;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.net.URL;
import java.util.Vector;

import kernel.udp.invoke.UDPClient;
import kernel.udp.invoke.XmlRpcClientConfigImpl;
import config.PSG_Configuration;



public class QueryClient {

	public static Vector myQueries = new Vector();
	
	public static UDPClient getXmlRpcOutgoingConnection()throws Exception
	{

		// Setup HTTP Connection [Possible Bug]
		XmlRpcClientConfigImpl CSM_Configuration = new XmlRpcClientConfigImpl(PSG_Configuration.QueryProcessorAddress);
        UDPClient client = new UDPClient(CSM_Configuration);

		return client;
	}
	
	public static String queryMCS(String queryString, String ID_KEY) throws Exception{

		Object[] params = new Object[]
		{ new String(queryString), new String(ID_KEY)};

		String result = (String)getXmlRpcOutgoingConnection().execute("PSG_Manager.queryMCS", params);
		
		return result;
	
		
	}
	
}

